import './style/AdviceManagement.less';
import { Space, Table, Input, DatePicker } from 'antd';
import {React,useState} from 'react';
export default function AdviceManagement(props){
    const {Search} = Input;
    const { RangePicker } = DatePicker;
    const columns = [
        {
          title: '投诉单号',
          dataIndex: 'adviceId',
          key: 'adviceId',
        //   className: "table-head-bg",
          //render接收一个函数，函数的text参数代表title的值,record代表此条记录的data对象
          //render: (text,record) => <NavLink to={`/management/dmInfromation/${record.id}`}>{text}</NavLink>,
        },
        {
          title: '投诉信息',
          dataIndex: 'adviceInformation',
          key: 'adviceInformation',
        //   className: "table-head-bg",
        },
        {
          title: '用户',
          dataIndex: 'userId',
          key: 'userId',
        //   className: "table-head-bg",
        },
        {
          title: '操作',
          key: 'action',
        //   className: "table-head-bg",
          render: (_, record) => (
            <Space size="middle">
              <a>修改</a>
              <a>删除</a>
            </Space>
          ),
        },
      ];
    const [data,setData] = useState([
        {
            key: '1',
            adviceId: '11123234',
            adviceInformation: '已完成',
            userId: 'Nasasdasdadad',
        },
        {
            key: '2',
            adviceId: '234234234',
            adviceInformation: '已完成',
            userId: 'Nasasdasdadad',
        },
        {
            key: '3',
            adviceId: '11123234',
            adviceInformation: '已完成',
            userId: 'Nasasdasdadad',
        }
    ]);
    const [total,setTotal] = useState(data.length);
    return (
        <div>
        <div className="mapage-header">{props.title}</div>
        <div className='madata-container'>
            <div className='madata-search'>
              <Search 
                placeholder="请输入想查找的投诉单号"  
                enterButton
                style={{width: 400}}
                // onSearch={handleStoreSearch}
                />
              <RangePicker style={{marginLeft:20}}/>
            </div>
            <Table 
            columns={columns} 
            dataSource={data} 
            pagination={{
                total:total,
                showSizeChanger:true,
                showQuickJumper:true,
                showTotal:(total) => `Total ${total} items`,
            }}
            style={{marginTop:20}}
            />
        </div>
    </div>
    )
}